#include "addfile.h"
#include <QFileDialog>

AddFile::AddFile(QString filename,QWidget *parent, Qt::WFlags f )
	: QDialog(parent,f)
{
	setupUi(this);
	AddFile::filename->setText(filename);
	connect(buttonBox,SIGNAL(accepted()),
		this,SLOT(accept()));
	connect(buttonBox,SIGNAL(rejected()),
		this,SLOT(reject()));
}

QString AddFile::getFileName()
{
	return filename->text();
}
bool AddFile::getStartNow(){
	return start->isChecked();
}
QString AddFile::getDir()
{
	return directory->text();
}

AddFile::~AddFile()
{

}


void AddFile::on_toolButton_clicked()
{
	QString fname = QFileDialog::getOpenFileName(this,tr("Add torrent"),
		QString(),tr("Torrent's (*.torrent)"));
	filename->setText(fname);
}
